<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_2
 * @license    GNU/GPL
*/
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.application.component.view');
 
/**
 * HTML View class for the JobsWorld Component
 *
 * @package    JobsWorld
 */
 
class JobsViewIndholdOld extends JView
{
    function display($tpl = null)
    {
		global $mainframe, $option;
       	$model = &$this->getModel();
		$session =& JFactory::getSession();
		//$data = JModel::getInstance( 'Jobs', 'JobsModel');
		//$this->assignRef('data',		$data);
		$user		= JFactory::getUser();
		
		$is_user = false; 
		$is_user_caterer = false; 
		foreach ($user->groups as $key => $value){
			if($value==9) {
				$is_user_caterer = true; 
			}
			if($value==2) {
				$is_user = true; 
			}
		}
		
		
		
		$this->assignRef( 'model',	$model );
		
		
		$orders_old_total = $model->getOldOrdersUser($user->id);
		$this->assignRef( 'orders_old_total',	count($orders_old_total) );
		
		
		if(JRequest::getVar('see')=='all') { 
			$orders_old	= $orders_old_total;
		} else {
			$orders_old	= $model->getOldOrdersUser($user->id,0,1);
		}
		
		$this->assignRef( 'orders_old',	$orders_old );
		
		
		
        parent::display($tpl);
    }
}
?>